const express = require("express");
const router = express.Router();
const contactDB = require("../../db/contact");

// 鉴权
router.use((req,res,next)=>{
    if(!req.session.userInfo || !req.session.userInfo.admin){
        return res.send({
            code:6,
            msg:'权限不足'
        })
    }
    next();
})

// check
router.post("/check",(req,res)=>{
    res.send({
        code:0,
        msg:'欢迎！'
    })
})

// 友链相关
router.use('/link',require('./link'))

// 文章相关
router.use('/article',require('./article'))

//contact
router.use("/contact", require("./contact"))

module.exports =router;